package sitemaps;

import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

public class Sitemap {

	private static final Logger LOG = Logger.getLogger(Sitemap.class.getName());
	private final String baseUrl;
	private final Map<String, SitemapUrl> urls = new HashMap<String, SitemapUrl>();
	
	public Sitemap(String baseUrl) {
		this.baseUrl = new SlashAdder().completeSlash(baseUrl);
	}

	public Collection<SitemapUrl> values() {
		return urls.values();
	}

	public void add(String loc, Date lastmod) {
		LOG.info(loc);
		urls.put(loc, new SitemapUrl(baseUrl + loc, lastmod));
	}
	
	public String getBaseUrl() {
		return baseUrl;
	}
	
	
}
